import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    islogin:sessionStorage.getItem('islogin')||false,
    uname:sessionStorage.getItem('uname')||'',
    upwd:sessionStorage.getItem('upwd')||'',
    token:sessionStorage.getItem('token')||'',
    correctNum:sessionStorage.getItem('correctNum')||'',
    row:"",
  },
  mutations: {
    login_mutation(state,payload){
      state.islogin=true;
      state.uname=payload.uname;
      state.upwd=payload.upwd;
      state.token=payload.token;
      state.correctNum=payload.correctNum;
    },
    out_mutation(state){
      state.islogin=false;
      state.uname=state.uname;
      state.upwd=state.upwd;
      state.token=state.token;
      state.correctNum=state.correctNum;
    }
  },
  actions: {
  },
  modules: {
  }
})
